import { domainService } from '~/config/server'
import { NetService } from '~/utils/net.service'
import { Inject, Debounce } from "~/core/decorator";

export class SmartCollectionService {

  @Inject(NetService)
  private netService: NetService
  /**
   * 智能发送短信数据查询
   */
  @Debounce()
  public getAllCollectionCaseInfo(data, page?, sort?) {
    return this.netService.send({
      server: domainService.smartCollectionController.getAllCollectionCaseInfo,
      data,
      page,
      sort
    })
  }

  /**
   * 获取发送短信的联系人列表
   * @param data
   */
  public getPersonalContacts(data: any) {
    return this.netService.send({
      server: domainService.smartCollectionController.getPersonalContacts,
      data,
    })
  }

  /**
   * 批量发送短信
   * @param data
   */
  @Debounce()
  public batchSendMessage(data: any) {
    return this.netService.send({
      server: domainService.smartCollectionController.batchSendMessage,
      data,
      option: true
    })
  }

  /**
   * 批量发邮件
   * @param data
   */
  @Debounce()
  public batchSendMail(data: any) {
    return this.netService.send({
      server: domainService.smartCollectionController.batchSendMail,
      data,
      option: true
    })
  }

  /**
   * 获取邮件发送人列表
   * @param data
   */
  public getMailPersonal(data: any) {
    return this.netService.send({
      server: domainService.smartCollectionController.getMailPersonal,
      data,
      option: true
    })
  }
}
